package acceptance;

import junit.framework.Assert;




/**
 * @author reut
 * tests different parameters of login
 * IMPORTANT:in order to work these conditions need to hold:
 *  not registered: username mimi
 *  registered: username: dani,password:1234
 *  adminId:0
 */
public class AddModeratorPrivilegesTest extends ProjectTest
{
	@Override
	public void setUp(){
		super.setUp();
		this._bridge.register("dani", "1234");
		this._bridge.login("dani", "1234");
	}

	/**
	 *  tests when username is not in the system
	 */
	public void testUserNameNotFoundAddModeratorPrivilegesTest()
	{

		Assert.assertFalse("username not found", this._bridge.addModaratorPrivileges(0, "mimi"));
	}

	/**
	 * tests when adminId doesn't have the permission to add the privileges
	 */
	public void testUnpermittedActionAddModeratorPrivileges()
	{

		Assert.assertFalse("admin doesn't have the permission to add the privileges", this._bridge.addModaratorPrivileges(5, "dani"));
	}

	/**
	 * tests cases of successful Adding Moderator Privileges
	 */
	public void testCorrectAddModeratorPrivileges()
	{

		Assert.assertTrue("added privileges succssesfuly", this._bridge.addModaratorPrivileges(1, "dani"));

	}
}
